package wml.clipstore.base;

public class Entity {

	private Identifier identifier = new Identifier(super.hashCode() + "@"
			+ this.getClass().getName());

	public void setIdentifier(Identifier identifier) {
		this.identifier = identifier;
	}

	public Identifier getIdentifier() {
		return new Identifier(this.hashCode() + "");
	}

	@Override
	public int hashCode() {
		String[] s = this.identifier.toString().split("@");
		return Integer.parseInt(s[0]);
	}

	@Override
	public boolean equals(Object o) {
		return this.hashCode() == o.hashCode();
	}

	@Override
	public String toString() {
		return this.identifier.toString();
	}

}
